<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="ww" uri="webwork" %>
<ww:bean name="'com.css.apps.base.dict.service.DictMan'" id="dictID" />
<form class="form-horizontal table-form" name="task_form"  id="task_form" action="dirTimerTask.action"  onsubmit="return $action.query(this)">
    <input type="hidden" name="page.orderFlag" class="order-flag" value="<ww:property value='page.orderFlag'/>"> 
	<input type="hidden" name="page.orderString" class="order-string" value="<ww:property value='page.orderString'/>">
	<input type="hidden" name="page.pageSize" class="page-size" value="<ww:property value='page.pageSize'/>">
	<input type="hidden" name="page.totalPages" class="page-count" value="<ww:property value='page.totalPages'/>">
	<input type="hidden" name="page.currentPage" class="page-current" value="<ww:property value='page.currentPage'/>">
	<div class="table-header">
		<div class="table-search">
			<ul>
			<li>
			<input class="input-medium" type="text" id="nameSea" name="nameSea" placeholder="请输入任务名称" value="<ww:property value='nameSea'/>"  maxlength="10" > 
			</li>
				<li>状态：<ww:select attributes="class='input-small'" name="'openFlag'" id="openFlag" value="openFlag"  list="#dictID.getDictListQuery('d_openflag')" listKey="code" listValue="name"></ww:select> </li>
			    <li>
			       <ww:button css="btn green" caption="查询" funcode="task_admin/dirTimerTask" type="submit"></ww:button>
			    </li>
			</ul>
		</div>
		<div class="table-btn">
			<div class="btn-group">
				<ww:link funcode="task_admin/addTimerTask"  target="cssDialog" css="btn" caption="添加" title="添加任务" rel="addTimerTask" href="getTimerTask.action"></ww:link>
			</div>
			<div class="btn-group">
			    <ww:link funcode="task_admin/delTimerTask" css="btn" caption="批量删除"  onclick="$action.execBatch(this,{url:'delTimerTask.action'});"></ww:link>
			</div>
			<div class="btn-group">
			    <ww:dropdown funcode="task_admin/updTimerTasksStatus" value="model" list="#dictID.getDictType('d_openflag')" listKey="name" caption="设置状态" onclick="$action.execBatch(this,{url:'updTimerTasksStatus.action?openFlag=%{#model.code}'})" />  
			</div>
		</div>

	</div>
	<table class="table table-bordered">
		<thead>
			<tr>
				<th width="25px"><input group="ids" class="cleck-all" type="checkbox"/></th>
				<th width="110px">操作</th>
				<th width="15%" order-field="name" class="order">任务名称</th>
				<th width="10%">任务描述</th>
				<th width="15%">作业类型</th>
				<th>执行类</th>
				<th>执行参数</th>
				<th width="15%">执行公式</th>
				<th width="30px" order-field="openFlag" class="order">开启状态</th>
			</tr>
		</thead>
		<tbody>
			<ww:iterator value="page.results" id="data"> 
			<tr  rel="<ww:property value='uuid' />">
				<td class="text-center"><input type="checkbox"  name="ids" id="ids" value="<ww:property value="uuid" />"/></td>
				<td class="text-center">
				    <ww:link funcode="task_admin/updTimerTask" caption="修改"  title="修改任务" target="cssDialog"  rel="getTimerTask" href="getTimerTask.action?uuid=%{uuid}" ></ww:link>&nbsp;
				    <ww:link funcode="task_admin/delTimerTask" caption="删除" onclick="$action.exec(this,{url:'delTimerTask.action?ids=%{uuid}'})" href="javascript:;"></ww:link>&nbsp;
					<ww:link funcode="task_admin/execTimerTask" caption="执行"  onclick="exec('%{uuid}')" title="%{name}" href="javascript:;"></ww:link>&nbsp;
				</td>
				<td ><ww:property value="name"/></td>
				<td ><ww:property value="description"/></td>
				<td ><ww:property value="#dictID.getDictType('d_job_type', jobType).name" /></td>
				<td ><ww:property value="exeClass"/></td>
				<td ><ww:property value="exePara"/></td>
				<td ><ww:property value="exeCorn"/></td>
				<td class="text-center"><ww:property value="#dictID.getDictType('d_openflag',openFlag).name" /></td>
			</tr>
			</ww:iterator>
		</tbody>
	</table>
	<div class="pagination"> <ww:property value="page.pageSplit"/></div>
</form>
<script type="text/javascript">
function exec(uuid){
	$css.post('execTimerTask.action',{'uuid':uuid},function(data){
		if(data.result==0){           
		   $css.tip(data.msg);
		}else{
		   $css.alert(data.msg);
		}
	},'json');
}
</script>
